<?php session_start();

require("commands.php");

$command = "";

if(isset($_POST) && isset($_POST['command'])){
	$command = $_POST['command'];
}
else if(isset($_GET) && isset($_GET['command'])) {
	$command = $_GET['command'];
}
else{
	//echo "it didn't get into the first if statement";
}

if($command == "executeQuery"){

	$query = $_POST["query"];
	$type = $_POST["type"];

	$result = executeQuery($query,$type);
	
	$_SESSION["result"] = $result;

	header("Location:../query.php");
}

?>